﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section styles{
    @*<link href="~/Scripts/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" />*@
}
<div id="moldusetimeListTable" class="main-content">
    <h3 class="page-title">模具寿命管理mould Life management</h3>


    <div class="panel panel-default">
        <div class="panel-heading">
            <p class="panel-title">条件查询Condition query</p>
            <div class="right">
                <button type="button" class="btn-toggle-collapse"><i class="fa fa-angle-up"></i></button>
            </div>
        </div>
        <div class="panel-body container-fluid">
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group input-group-sm">
                        <span class="input-group-addon">模具编号mould number</span>
                        <input type="text" class="form-control" v-model="searchModel.queryMoldID" />
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group input-group-sm">
                        <span class="input-group-addon">产品编号Product number</span>
                        <input class="form-control" v-model="searchModel.querySegment" />
                    </div>
                </div>
                <br />
                <div class="col-sm-6">
                    <div class="input-group input-group-sm">
                        <span class="input-group-addon">完成时间从Completion time from(yyyy-mm-dd)</span>
                        <input type="text" class="form-control " v-model="searchModel.transDateS" />
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="input-group input-group-sm">
                        <span class="input-group-addon">完成时间至Completion time to(yyyy-mm-dd)</span>
                        <input class="form-control "  v-model="searchModel.transDateE" />
                    </div>
                </div>

            </div>

            <div class="row">
                <div class="col-sm-12 text-right">
                    <br />
                    <button class="btn btn-default btn-sm" v-on:click="SearchReset">
                        <i class="fa fa-eraser"></i> 清空empty
                    </button>
                    <button class="btn btn-default btn-sm" v-on:click="SearchMoldUseTime">
                        <i class="fa fa-search"></i> 查询query
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="panel-body">
        <button class="btn btn-primary" v-on:click="AddMold">
            <i class="fa fa-plus"></i> 新增设备信息Newly added equipment information
        </button>
        <button class="btn btn-default" v-on:click="ExportMold()" v-bind:disabled="isExportDisabled">
            <i class="fa fa-download"></i> 导出设备信息Export device information <i v-if="isExportLoading" class="fa fa-spinner fa-spin"></i>
        </button>
        <br />
        <br />
        <div style="width:2000px; overflow-x:scroll">
            <table class="table table-bordered" v-if="isNotEmptyObject(pageModel.results)">
                <thead>
                    <tr>
                        <td colspan="18">
                            <div class="form-inline text-right">
                                <label class="control-label">每页记录数Records per page：</label>
                                <select class="form-control input-sm" style="width:auto;" v-model="pageModel.pageSize">
                                    <option value="10">10条Article 10</option>
                                    <option value="30">30条Article 30</option>
                                    <option value="50">50条Article 50</option>
                                </select>
                            </div>
                        </td>
                    </tr>
                    <tr width="50%">
                        <th rowspan="2">序号Serial number<a v-on:click="ChangeOrderByID($event)"><i class="fa fa-angle-up"></i></a></th>
                        <th colspan="10" style="text-align:center">工程资料Engineering data</th>
                        <th rowspan="2">Oracle生产数量Oracle production quantity</th>
                        <th rowspan="2">工模剩余寿命Remaining life of tooling</th>
                        <th rowspan="2">备注remarks</th>
                        <th rowspan="2">创建时间Creation time</th>
                        <th rowspan="2">创建人Creator</th>
                        <th rowspan="2">更新时间renew time</th>
                        <th rowspan="2">更新人renewer</th>
                        <th rowspan="2">操作operation</th>
                    </tr>
                    <tr>
                        <th>模号Module number<a v-on:click="ChangeOrderByID($event)"><i class="fa fa-angle-up"></i></a></th>
                        <th>产品编号Product number<a v-on:click="ChangeOrderBySegment($event)"><i class="fa fa-angle-up"></i></a></th>
                        <th>产品描述Product description</th>
                        <th>状态state</th>
                        <th>工模设计寿命Design life of tooling</th>
                        <th style="text-align:center">
                            模具尺寸mould size<br />
                            <p style="width:140px;text-align:center; font-size:12px;transform: scale(0.8);">(高*mm宽*mm厚*mm)(height * mm width * mm thickness * mm)</p>
                        </th>
                        <th>设计型腔数Design cavity number</th>
                        <th>模具出品数Out product qty</th>
                        <th>UPH</th>
                        <th>适啤机台(吨)Beer machine (ton)</th>

                    </tr>
                </thead>
                <tbody v-for="(mold, index) in pageModel.results">
                    <tr>
                        <td>{{mold.BaseInfo.ID}}</td>
                        <td>{{mold.BaseInfo.MoldID}}</td>
                        <td>{{mold.BaseInfo.Segment}}</td>
                        <td>{{mold.BaseInfo.Descrption}}</td>
                        <td>
                            <span v-for="(value, key, idx) in statusDictionary">
                                <span v-if="value==mold.BaseInfo.Status">{{key}}</span>
                            </span>
                        </td>
                        <td>{{mold.BaseInfo.DesignedLife}}</td>
                        <td>{{mold.BaseInfo.Size}}</td>
                        <td>{{mold.BaseInfo.CavityNum}}</td>
                        <td>{{mold.BaseInfo.OutProductNum}}</td>
                        <th>{{mold.BaseInfo.UPHvalue}}</th>
                        <td>{{mold.BaseInfo.MachineType}}</td>
                        <td>{{mold.BaseInfo.ProductionNum}}</td>
                        <td>{{mold.BaseInfo.ResidualLife}}</td>
                        <td>
                            <textarea style="border:none;" readonly="readonly">{{mold.BaseInfo.Remarks}}</textarea>
                        </td>
                        <td>{{dateFormat(mold.BaseInfo.CreateDate)}}</td>
                        <td>{{mold.BaseInfo.CreateBy}}</td>
                        <td>{{dateFormat(mold.BaseInfo.UpdateDate)}}</td>
                        <td>{{mold.BaseInfo.UpdateBy}}</td>
                        <td>
                            <button type="button" style="width:40%" class="btn btn-info btn-sm" v-on:click="EditMold(index)">详细detailed</button>
                            <button type="button" style="width:40%" class="btn btn-danger btn-xs" v-on:click="DeleteMold(mold.BaseInfo.ID)">删除delete</button>
                        </td>
                    </tr>
                </tbody>
                <tbody>
                    <tr>
                        <td colspan="18">
                            <nav class="text-right" aria-label="Page navigation">
                                <ul class="pagination">
                                    <li v-if="pageModel.pageIdx > 1">
                                        <a href="#" aria-label="Previous" v-on:click="GotoPage(pageModel.pageIdx - 1)">
                                            <span aria-hidden="true">
                                                <i class="fa fa-angle-left"></i> 上一页previous page
                                            </span>
                                        </a>
                                    </li>
                                    <li v-if="pageModel.pageIdx != 1">
                                        <a href="#" v-on:click="GotoPage(1)">
                                            <i class="fa fa-step-backward"></i>
                                        </a>
                                    </li>
                                    <template v-for="idx in pageModel.pageLength">
                                        <li v-if="pageModel.pageIdx - idx > -5 && pageModel.pageIdx - idx < 5 " v-bind:class="pageModel.pageIdx == idx ? 'active' : ''">
                                            <a href="#" v-on:click="GotoPage(idx)">{{idx}}</a>
                                        </li>
                                    </template>
                                    <li v-if="pageModel.pageIdx != pageModel.pageLength">
                                        <a href="#" v-on:click="GotoPage(pageModel.pageLength)">
                                            <i class="fa fa-step-forward"></i>
                                        </a>
                                    </li>
                                    <li v-if="pageModel.pageIdx < pageModel.pageLength">
                                        <a href="#" aria-label="Next" v-on:click="GotoPage(pageModel.pageIdx + 1)">
                                            <span aria-hidden="true">
                                                下一页next page <i class="fa fa-angle-right"></i>
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

@section scripts{
<script type="text/javascript" src="~/Scripts/pageJs/MoldUseTime/UseTime.js?v=@DateTime.Now.ToFileTimeUtc()"></script>

}
